package org.example.demo;

import org.example.login.LoginPenal;
import org.example.util.FrameUtil;

import javax.swing.*;
import java.awt.*;

/**
 * @author :Mr.zhou
 * @description: TODO edit class Description
 * @create date: 2025/2/22 10:56
 */
public class FlowLayoutDemo {
    public static void main(String[] args) {
        JFrame frame = new JFrame("Frame");
        frame.setSize(320, 448);

        JPanel jPanel = new LoginPenal("/bg001.jpg");
        jPanel.setLayout(new FlowLayout());
        frame.add(jPanel);

        // 初始化窗口图标数据
        FrameUtil.initFrame(frame, "系统登录","/00.png");

        JLabel userLable = new JLabel("用户名：",SwingConstants.LEFT);
        JTextField uertxt = new JTextField(18);

        // 一个中文相当于4个空格
        JLabel pwdLable = new JLabel("密    码：",SwingConstants.LEFT);
        JPasswordField jPasswordField=new JPasswordField(18);
        Insets insets = new Insets(20, 0, 20, 0);

        jPanel.add(userLable,insets);
        jPanel.add(uertxt);

        jPanel.add(pwdLable,insets);
        jPanel.add(jPasswordField);

        JButton loginBut = new JButton("登录");
        JButton registerBut = new JButton("注册");

        jPanel.add(loginBut,insets);
        jPanel.add(registerBut);

        //设置窗口是否可见
        frame.setVisible(true);
    }
}
